package jscinttools.transmission;
import hep.aida.IMeasurement;

/**
 *  Analyse photon rates for TDC
 *
 * @author     Marc-Antoine Verdier
 * @created    25 janvier 2012
 */
public interface RateTDC {
	/**
	 *  Calculate the total number of segments recorded
	 *
	 * @return    The number of segments
	 */
	public int segmentsTotal();

	/**
	 *  Calculate the total number of segments without any memory errors recorded
	 *
	 * @return    The number of segments
	 */
	public int segments();

	/**
	 *  Calculate the total number of counts (including the ones in segments with memory errors) on a channel
	 *
	 * @param  ch  The selected channel
	 * @return     Number of counts
	 */
	public int countsTotal(int ch);

	/**
	 *  Calculate the number of counts on a channel. Segments with memory errors are skiped
	 *
	 * @param  ch  The selected channel
	 * @return     Number of counts
	 */
	public int counts(int ch);

	/**
	 *  Calculate the counts rate (including the ones in segments with memory errors) on a channel
	 *
	 * @param  ch  The selected channel
	 * @return     The rate with error bars
	 */
	public IMeasurement rateTotal(int ch);

	/**
	 *  Calculate the counts rate on a channel. Segments with memory errors are skiped
	 *
	 * @param  ch  The selected channel
	 * @return     The rate with error bars
	 */
	public IMeasurement rate(int ch);

	/**
	 *  Calculate the counts rate on a channel after substraction of the dark counts rate. Segments with memory errors are skiped
	 *
	 * @param  ch             The selected channel
	 * @param  drkCountsRate  The dark counts rate with error bars
	 * @return                The rate with error bars
	 */
	public IMeasurement rate(int ch, IMeasurement drkCountsRate);

	/**
	 *  Calculate the counts rate on a channel after substraction of the dark counts rate. Segments with memory errors are skiped
	 *
	 * @param  ch             The selected channel
	 * @param  drkCountsRate  The RateTDC object used for measuring the dark conts rate
	 * @return                The rate with error bars
	 */
	public IMeasurement rate(int ch, RateTDC drkCountsRate);

	/**
	 *  Calculate the ratio of counts rate on two channels after substraction of the dark counts rate. Segments with memory errors are skiped
	 *
	 * @param  ch1            The 1st selected channel
	 * @param  ch2            The 2nd selected channel
	 * @param  drkCountsRate  The RateTDC object used for measuring the dark conts rate
	 * @return                The rate with error bars
	 */
	public IMeasurement rateRatio(int ch1, int ch2, RateTDC drkCountsRate);

	/**
	 *  Calculate the ratio of counts rate on two channels after substraction of the dark counts rate. Segments with memory errors are skiped
	 *
	 * @param  ch1             The 1st selected channel
	 * @param  drkCountsRate1  The dark counts rate with error bars for the 1st channel
	 * @param  ch2             The 2nd selected channel
	 * @param  drkCountsRate2  The dark counts rate with error bars for the 2nd channel
	 * @return                 The rate with error bars
	 */
	public IMeasurement rateRatio(int ch1, IMeasurement drkCountsRate1, int ch2, IMeasurement drkCountsRate2);
}

